package thread;

public class Demo9 {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            for (int i = 0; i < 5; i++) {
                System.out.println("hello thraed1");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        },"thread1");
//        t1.start();
        t1.run();

        Thread t2 = new Thread(()->{
            for (int i = 0; i < 5; i++) {
                System.out.println("hello thraed2");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"thread2");
        t2.start();

    }
}
